def modify_number(num):
    print(f"函数内修改前 - num的id: {id(num)}")
    num += 10
    print(f"函数内修改后 - num的id: {id(num)}")
    return num


def modify_string(text):
    print(f"函数内修改前 - text的id: {id(text)}")
    text += " World"
    print(f"函数内修改后 - text的id: {id(text)}")
    return text


if __name__ == '__main__':
    # 测试数值类型
    x = 5
    print(f"调用函数前 - x的id: {id(x)}")
    result = modify_number(x)
    print(f"原始x值: {x}")  # 输出: 5
    print(f"修改后结果: {result}")  # 输出: 15

    # 测试字符串类型
    s = "Hello"
    print(f"调用函数前 - s的id: {id(s)}")
    new_s = modify_string(s)
    print(f"原始s值: {s}")  # 输出: Hello
    print(f"修改后结果: {new_s}")  # 输出: Hello World
